const express = require('express');
const proxy = require('http-proxy-middleware');//引入代理中间件
const app = express();
app.use(express.static('public'));

const apiProxy = proxy('/nmltjf', { target: 'http://10.197.1.84:8081',changeOrigin: true });
app.use('/nmltjf/*', apiProxy);//api子目录下的都是用代理
 
app.get('/index.html', function(req,res){
     res.sendFile(__dirname+'/dist/index.html');
});
 
app.listen(3000, () => {
  console.log('Listening on: http://localhost:3000');
});